#pragma once
#include<iostream>

using namespace std;

class Shape {
public:
	virtual void calVolume() = 0;
	virtual void display() = 0;
};

class Cube :public Shape {
private:
	double length, width, height, volume;
public:
	Cube(double length, double width, double height) :length(length),width(width),height(height){}
	void calVolume() {
		volume = length * width * height;
	}
	void display() {
		cout << "the cube is" << volume << endl;
	}
};

class Cylinder :public Shape{
private:
	double radius, height, volume;
public:
	Cylinder(double radius,double height):radius(radius),height(height){}
	void calVolume() {
		volume = height * 3.14 * radius * radius;
	}
	void display() {
		cout << "the cylinder is " << volume << endl;
	}

};


class Cone :public Shape {
private:
	double radius, height, volume;
public:
	Cone(double radius,double height):radius(radius),height(height){}
	void calVolume() {
		volume = height * 3.14 * radius * radius / 3;
	}
	void display() {
		cout << "the cone is" << volume << endl;
	}
};


class Sphere:public Shape	
{
public:
	Sphere(double radius) :radius(radius) {};
	void calVolume() {
		volume = (4 / 3) * 3.14 * radius * radius * radius;
	}
	void display() {
		cout << "the sphere is " << volume << endl;
	}

private:
	double radius, volume;
};

